﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Drawing;
using System.Collections.Generic;
#pragma warning disable 0618
namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for BaseFontTest and is intended
    ///to contain all BaseFontTest Unit Tests
    ///</summary>
    [TestClass()]
    public class BaseFontTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for BaseFont Constructor
        ///</summary>
        [TestMethod()]
        public void BaseFontConstructorTest() {
            BaseFont target = new BaseFont();
            Assert.AreEqual("<basefont/>", target.ToString());
        }

        /// <summary>
        ///A test for Color
        ///</summary>
        [TestMethod()]
        public void ColorTest() {
            BaseFont target = new BaseFont();
            Nullable<Color> expected = Color.Red;
            Nullable<Color> actual;
            target.Color = expected;
            actual = target.Color;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Face
        ///</summary>
        [TestMethod()]
        public void FaceTest() {
            BaseFont target = new BaseFont();
            target.Face.Add("arial");
            target.Face.Add("courier");
            Assert.IsTrue(target.Face.Count == 2);
            Assert.IsTrue(target.Face.Contains("arial"));
            Assert.IsTrue(target.Face.Contains("courier"));
        }

        /// <summary>
        ///A test for Size
        ///</summary>
        [TestMethod()]
        public void SizeTest() {
            BaseFont target = new BaseFont();
            Nullable<int> expected = 3;
            Nullable<int> actual;
            target.Size = expected;
            actual = target.Size;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void TestToString() {
            BaseFont target = new BaseFont();
            target.Color = Color.Red;
            target.Face.Add("arial");
            target.Face.Add("courier");
            target.Size = 3;
            Assert.AreEqual("<basefont color=\"#FF0000\" " +
                "face=\"arial,courier,\" " +
                "size=\"3\"/>", target.ToString());
        }
    }
}
